﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
using DevExpress.Web.Mvc;

namespace ThinhTien.Admin
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();

            log4net.Config.XmlConfigurator.Configure();
        }

        protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
        {
            //var themes = new List<KeyValuePair<string, string>>();
            //themes.Add(new KeyValuePair<string, string>("Default", "Default"));
            //themes.Add(new KeyValuePair<string, string>("DevEx", "DevExpress Style"));
            //themes.Add(new KeyValuePair<string, string>("Metropolis", "Metropolis"));
            //themes.Add(new KeyValuePair<string, string>("MetropolisBlue", "Metropolis Blue"));

            //themes.Add(new KeyValuePair<string, string>("Office2010Blue", "Office 2010 Blue"));
            //themes.Add(new KeyValuePair<string, string>("Office2010Black", "Office 2010 Black"));
            //themes.Add(new KeyValuePair<string, string>("Office2010Silver", "Office 2010 Silver"));

            //themes.Add(new KeyValuePair<string, string>("Office2003Blue", "Office 2003 Blue"));
            //themes.Add(new KeyValuePair<string, string>("Office2003Olive", "Office 2003 Olive"));
            //themes.Add(new KeyValuePair<string, string>("Office2003Silver", "Office 2003 Silver"));

            //themes.Add(new KeyValuePair<string, string>("Aqua", "Aqua"));
            //themes.Add(new KeyValuePair<string, string>("Glass", "Glass"));
            //themes.Add(new KeyValuePair<string, string>("BlackGlass", "Black Glass"));
            //themes.Add(new KeyValuePair<string, string>("PlasticBlue", "Plastic Blue"));
            //themes.Add(new KeyValuePair<string, string>("RedWine", "Red Wine"));
            //themes.Add(new KeyValuePair<string, string>("SoftOrange", "Soft Orange"));
            //themes.Add(new KeyValuePair<string, string>("Youthful", "Youthful"));

            DevExpressHelper.Theme = "DevEx";
        }
    }
}